function getPage(page,pageSize,name){
    return axios({
        method:'get',
        url:'http://localhost:8080/cake/getMSG?page='+page+'&pageSize='+pageSize+'&name='+name
    })
}
function editStatus(cake){
    return axios({
        method:'put',
        url:'http://localhost:8080/cake/editCake',
        data:{...cake}
    })
}
function getList(){
    return axios({
        method:'get',
        url:'http://localhost:8080/category/getList'
    })
}
function submitCake(Cake){
    return axios({
        method:"post",
        url:"http://localhost:8080/cake/submit",
        data:Cake
    })
}
function deleteApi(id){
    return axios({
        method:'delete',
        url:'http://localhost:8080/cake/deleteCake?id='+id

    })
}
function requestUrlParam(){
    let url = location.href
    let index = url.indexOf("?")
    let flagUrl = url.slice(index+11,index+16)
    let idIndex = url.indexOf("&")
    let id = url.slice(idIndex+4)
    if(flagUrl=='false'){
        return id;
    }
}
function getCakeInfo(id){
    return axios({
        method:'get',
        url:'http://localhost:8080/cake/getCake?id='+id
    })
}
function EditCake(cake){
    return axios({
        method:"put",
        url:"http://localhost:8080/cake/editCake",
        data: {...cake}
    })
}
